#ifndef REGISTER_H
#define REGISTER_H

#include <QtGui/QDialog>
#include <QWidget>


namespace Ui {
    class Register;
}


/*! \brief Register:
   A class that allows the user to join
   the MyChat community.
   */
class Register : public QDialog {
    Q_OBJECT

public:
    /*! Register
   \brief  A constructor for Register
   \param *parent
   */
    Register(QWidget *parent = 0);

    /*! ~Register
   \brief  A deconstructor Register
   */
    ~Register();

    /*! \var QString setUsername
    \brief  Set varable from UI textbox
    */
    QString setUsername();

    /*! \var QString setPssword
    \brief  Set varable from UI textbox
    */
    QString setPassword();    

    /*! \var QString setEmail
    \brief  Set varable from UI textbox
    */
    QString setEmail();


    /*! \var QString setCompare
    \brief  Set varable from UI textbox
    */
    QString setCompare();


protected:
    /*! ChangeEvent
   \brief  Use to receive the state being changed
   \para
  */
    void changeEvent(QEvent *e);

    /*! keyPressEvent
   \brief  When enter is pressed in Login UI,
   the Login information is sent.
   \para
   */
    void keyPressEvent(QKeyEvent * event);

private slots:
    /*! sendInfo
   \brief  Load ClietHandler instance with entered info
   to send to server.
   */
    void sendInfo();

    /*! reqApproved
   \brief  If Authorization is passed, open buddylist
   */
    void regApproved();

    /*! statusLabelUpdate
   \brief  Will display appropriate errot message in UI
   window.
   */
    void statusLabelUpdate();

    /*! statusLabelUpdate
   \brief  A check that both entered passwords match.
   \return 0 if passwords do not match
   1 if passwords match
   */
    bool comparePass();

   /*! backToLogin
   \brief  If register window is closed, login window
   is opened.
   */
    void backToLogin();

private:
    Ui::Register *m_ui;

};

#endif // REGISTER_H
